/*
 * @Author: 飞越疯人院 353362604@qq.com
 * @Date: 2022-09-15 16:48:46
 * @LastEditors: 飞越疯人院 353362604@qq.com
 * @LastEditTime: 2023-02-15 17:30:35
 * @FilePath: \adminstration\src\Common\Modal\TwoModalList\LabReportTemplates.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { API_LIST } from '../../Api/Api'
import { TwoAddBtn, ThrDeleteBtn } from '../options'
import { commonTableList } from '../config'

import { setSelectSort } from '../../Router/MenuBoxList'

export const PushFlowConfig = async ({ upDataEvent, data, ClientData }) => {
    let dataList = {
        type: '推送人员配置',
        hideInSearch: true,
        pageSize: 10,
        params: { PushFlowConfigUuid: data.uuid },
        classification: 'TableModal',
        get: API_LIST([data.uuid])['getPushFlowUserGetHaveUserList'],
        additional: { key: 'PushFlowConfigUuid', value: 'uuid' },
        options: [
            <TwoAddBtn
                upDataEvent={upDataEvent}
                title="添加人员"
                ThrKey="ThrModal"
                value="PushFlowConfig"
                data={data}
            />,
        ],
        columns: [
            {
                title: '人员id',
                dataIndex: 'userUuid',
                search: false,
                type: 'hidden',
                hideInTable: true,
            },

            { ...commonTableList.organizationUuid, valueEnum: ClientData.organization },
            {
                title: '账户',
                dataIndex: 'tableName',
                search: false,
            },
            {
                title: '姓名',
                dataIndex: 'fullName',
            },
            {
                title: '手机号',
                dataIndex: 'mobile',
            },
            {
                title: '操作',
                valueType: 'systemOperation',
                fixed: 'right',
                width: 100,
                hideInSearch: true,
                hideInAdded: true,
                hideInModify: true,
                render: (_, record) => {
                    return [
                        <ThrDeleteBtn
                            key="delete"
                            record={record.uuid}
                            upDataEvent={upDataEvent}
                            data={{ key: 'delete', url: 'delPushFlowUser', title: '删除人员' }}
                        />,
                    ]
                },
            },
        ],
    }
    return dataList
}
